<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilsecure: XilSecure Key Unwrap Server APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilsecure
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__xsecure__keyunwrap__server__apis.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">XilSecure Key Unwrap Server APIs</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga9ca0cf20d44fa54519566ff4360154f0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#ga9ca0cf20d44fa54519566ff4360154f0">XSECURE_MAX_KEY_STORE_CAPACTIY</a>&#160;&#160;&#160;(32U)</td></tr>
<tr class="memdesc:ga9ca0cf20d44fa54519566ff4360154f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum key store capacity.  <a href="#ga9ca0cf20d44fa54519566ff4360154f0">More...</a><br/></td></tr>
<tr class="separator:ga9ca0cf20d44fa54519566ff4360154f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaacb4b7c562037f76ce135fd2659024b4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#gaacb4b7c562037f76ce135fd2659024b4">XSECURE_SHARED_KEY_STORE_SIZE_OFFSET</a>&#160;&#160;&#160;(8U)</td></tr>
<tr class="memdesc:gaacb4b7c562037f76ce135fd2659024b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Key size offset.  <a href="#gaacb4b7c562037f76ce135fd2659024b4">More...</a><br/></td></tr>
<tr class="separator:gaacb4b7c562037f76ce135fd2659024b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6a82817e5b3bf270ed1e31200603742f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#ga6a82817e5b3bf270ed1e31200603742f">XSECURE_KEY_STORE_KEY_OFFSET</a>&#160;&#160;&#160;(4U)</td></tr>
<tr class="memdesc:ga6a82817e5b3bf270ed1e31200603742f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Key offset from key slot status.  <a href="#ga6a82817e5b3bf270ed1e31200603742f">More...</a><br/></td></tr>
<tr class="separator:ga6a82817e5b3bf270ed1e31200603742f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7a1499e52c8b2b547996df177d08dad4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#ga7a1499e52c8b2b547996df177d08dad4">XSECURE_AES_256BIT_KEY_BLOCK_SIZE</a>&#160;&#160;&#160;(40U)</td></tr>
<tr class="memdesc:ga7a1499e52c8b2b547996df177d08dad4"><td class="mdescLeft">&#160;</td><td class="mdescRight">AES 256-bit key block size.  <a href="#ga7a1499e52c8b2b547996df177d08dad4">More...</a><br/></td></tr>
<tr class="separator:ga7a1499e52c8b2b547996df177d08dad4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa701b146b5ca0fcc10c4540285282dd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#gaaa701b146b5ca0fcc10c4540285282dd">XSECURE_AES_128BIT_KEY_BLOCK_SIZE</a>&#160;&#160;&#160;(24U)</td></tr>
<tr class="memdesc:gaaa701b146b5ca0fcc10c4540285282dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">AES 128-bit key block size.  <a href="#gaaa701b146b5ca0fcc10c4540285282dd">More...</a><br/></td></tr>
<tr class="separator:gaaa701b146b5ca0fcc10c4540285282dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6e1d11a69ab8605cea40a370c6bacb07"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#ga6e1d11a69ab8605cea40a370c6bacb07">XSECURE_AES_KEY_SLOT_STATUS_FULL</a>&#160;&#160;&#160;(0x973AFB51U)</td></tr>
<tr class="memdesc:ga6e1d11a69ab8605cea40a370c6bacb07"><td class="mdescLeft">&#160;</td><td class="mdescRight">AES key status is full.  <a href="#ga6e1d11a69ab8605cea40a370c6bacb07">More...</a><br/></td></tr>
<tr class="separator:ga6e1d11a69ab8605cea40a370c6bacb07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga246507e2a1fe8390725754ef5bcc70b0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#ga246507e2a1fe8390725754ef5bcc70b0">XSECURE_KEY_STORE_ADDR</a>&#160;&#160;&#160;(0x00000000U)</td></tr>
<tr class="memdesc:ga246507e2a1fe8390725754ef5bcc70b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Key store address.  <a href="#ga246507e2a1fe8390725754ef5bcc70b0">More...</a><br/></td></tr>
<tr class="separator:ga246507e2a1fe8390725754ef5bcc70b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf1df351e91ee42e7c281b2e676ffda7b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__keyunwrap__server__apis.html#gaf1df351e91ee42e7c281b2e676ffda7b">XSecure_KeyUnwrap</a> (<a class="el" href="struct_x_secure___key_wrap_data.html">XSecure_KeyWrapData</a> *KeyWrapData)</td></tr>
<tr class="memdesc:gaf1df351e91ee42e7c281b2e676ffda7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function unwraps the given wrapped key and stores it along with metadata in Shared address between PMC and secure shell.  <a href="#gaf1df351e91ee42e7c281b2e676ffda7b">More...</a><br/></td></tr>
<tr class="separator:gaf1df351e91ee42e7c281b2e676ffda7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="gaaa701b146b5ca0fcc10c4540285282dd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_AES_128BIT_KEY_BLOCK_SIZE&#160;&#160;&#160;(24U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>AES 128-bit key block size. </p>

<p>Referenced by <a class="el" href="group__xsecure__keyunwrap__server__apis.html#gaf1df351e91ee42e7c281b2e676ffda7b">XSecure_KeyUnwrap()</a>.</p>

</div>
</div>
<a class="anchor" id="ga7a1499e52c8b2b547996df177d08dad4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_AES_256BIT_KEY_BLOCK_SIZE&#160;&#160;&#160;(40U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>AES 256-bit key block size. </p>

<p>Referenced by <a class="el" href="group__xsecure__keyunwrap__server__apis.html#gaf1df351e91ee42e7c281b2e676ffda7b">XSecure_KeyUnwrap()</a>.</p>

</div>
</div>
<a class="anchor" id="ga6e1d11a69ab8605cea40a370c6bacb07"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_AES_KEY_SLOT_STATUS_FULL&#160;&#160;&#160;(0x973AFB51U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>AES key status is full. </p>

</div>
</div>
<a class="anchor" id="ga246507e2a1fe8390725754ef5bcc70b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_KEY_STORE_ADDR&#160;&#160;&#160;(0x00000000U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Key store address. </p>

</div>
</div>
<a class="anchor" id="ga6a82817e5b3bf270ed1e31200603742f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_KEY_STORE_KEY_OFFSET&#160;&#160;&#160;(4U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Key offset from key slot status. </p>

<p>Referenced by <a class="el" href="group__xsecure__keyunwrap__server__apis.html#gaf1df351e91ee42e7c281b2e676ffda7b">XSecure_KeyUnwrap()</a>.</p>

</div>
</div>
<a class="anchor" id="ga9ca0cf20d44fa54519566ff4360154f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_MAX_KEY_STORE_CAPACTIY&#160;&#160;&#160;(32U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Maximum key store capacity. </p>

</div>
</div>
<a class="anchor" id="gaacb4b7c562037f76ce135fd2659024b4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_SHARED_KEY_STORE_SIZE_OFFSET&#160;&#160;&#160;(8U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Key size offset. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaf1df351e91ee42e7c281b2e676ffda7b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_KeyUnwrap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_secure___key_wrap_data.html">XSecure_KeyWrapData</a> *&#160;</td>
          <td class="paramname"><em>KeyWrapData</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function unwraps the given wrapped key and stores it along with metadata in Shared address between PMC and secure shell. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">KeyWrapData</td><td>is pointer to the <a class="el" href="struct_x_secure___key_wrap_data.html" title="Input and output parameters for Key wrap. ">XSecure_KeyWrapData</a> instance. </td></tr>
    <tr><td class="paramname">DmaPtr</td><td>is pointer to DMA instance which is used for AES and SHA</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS On success.</li>
<li>XST_INVALID_PARAM If any input parameter is invalid.</li>
<li>XSECURE_ERR_KEY_WRAP_SIZE_MISMATCH If wrapped key size is invalid.</li>
<li>XSECURE_ERR_AES_KEY_SIZE_NOT_SUPPORTED If AES key size is invalid.</li>
<li>XST_FAILURE On failure. </li>
</ul>
</dd></dl>
<p>Check for free key slot and update Key slot status address</p>
<p>Update the key slot with metadata</p>
<p>Clear the ephemeral AES key after the usage </p>

<p>References <a class="el" href="struct_x_secure___rsa_oaep_param.html#aec83801a64f9afa4244ceb8900611946">XSecure_RsaOaepParam::InputDataAddr</a>, <a class="el" href="struct_x_secure___key_wrap_data.html#a0a05d1878b7e0de78a277e45d387849f">XSecure_KeyWrapData::KeyMetaData</a>, <a class="el" href="struct_x_secure___key_wrap_data.html#a857f11d7fff5dfda00d6720ca658fdd4">XSecure_KeyWrapData::KeyWrapAddr</a>, <a class="el" href="struct_x_secure___rsa_oaep_param.html#aa512ea4ccd203ba5598c4de743b12d79">XSecure_RsaOaepParam::OutputDataAddr</a>, <a class="el" href="struct_x_secure___rsa_oaep_param.html#abc732af71d66ec9a66a84abf44c52749">XSecure_RsaOaepParam::OutputDataSize</a>, <a class="el" href="struct_x_secure___rsa_oaep_param.html#af3ada34163356c6f6dabaf1217119829">XSecure_RsaOaepParam::ShaInstancePtr</a>, <a class="el" href="struct_x_secure___rsa_oaep_param.html#a08d92ae0a9bc81faf738335de219ee13">XSecure_RsaOaepParam::ShaType</a>, <a class="el" href="struct_x_secure___key_wrap_data.html#ae0859090b231e6cdb8541514ace52cff">XSecure_KeyWrapData::TotalWrappedKeySize</a>, <a class="el" href="group__xsecure__keyunwrap__server__apis.html#gaaa701b146b5ca0fcc10c4540285282dd">XSECURE_AES_128BIT_KEY_BLOCK_SIZE</a>, <a class="el" href="group__xsecure__keyunwrap__server__apis.html#ga7a1499e52c8b2b547996df177d08dad4">XSECURE_AES_256BIT_KEY_BLOCK_SIZE</a>, <a class="el" href="group__xsecure__aes__server__apis.html#gaa26b61acf33b45fed961e0e3a59f7baa">XSECURE_AES_64BIT_BLOCK_SIZE</a>, <a class="el" href="group__xsecure__aes__server__apis.html#gga55cd9d64e04cce6a57d729b67a5f0c47a2e5b9343d2f9cc0e355b413d6a3848e3">XSECURE_AES_KEY_SIZE_128</a>, <a class="el" href="group__xsecure__aes__server__apis.html#ga4da9ead453ef1dbeebefeebb377eb94d">XSecure_AesKeyUnwrap()</a>, <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574af10eedc347b4d363632e86345fcde6c5">XSECURE_ERR_AES_KEY_SIZE_NOT_SUPPORTED</a>, <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574ae88263cbf5cdde15b1c36b2a6b4f069c">XSECURE_ERR_KEY_WRAP_SIZE_MISMATCH</a>, <a class="el" href="group__xsecure__generic__server__apis.html#ga11d8bbf7423a10f98cbcfd4796ea6d6a">XSecure_GetAesInstance()</a>, <a class="el" href="group__xsecure__rsa__server__apis.html#gabc66468fdd66a559fa567f631fbae91c">XSecure_GetRsaKeyInUseIdx()</a>, <a class="el" href="group__xsecure__rsa__server__apis.html#ga76632037ef8961e99b8b9b210d5f75f1">XSecure_GetRsaPrivateKey()</a>, <a class="el" href="group__xsecure__keyunwrap__server__apis.html#ga6a82817e5b3bf270ed1e31200603742f">XSECURE_KEY_STORE_KEY_OFFSET</a>, <a class="el" href="group__xsecure__generic__server__apis.html#ga808901e93cc5c143fc37f5e28744ef84">XSecure_MemCpy64</a>, <a class="el" href="group__xsecure__helper__server__apis.html#ga53fe2b16231ce29ca1d943967d122925">XSecure_MemCpyAndChangeEndianness()</a>, <a class="el" href="group__xsecure__rsa__server__apis.html#gaef98b03d932368574ec1123184b9a9e4">XSECURE_RSA_KEY_GEN_SIZE_IN_BYTES</a>, and <a class="el" href="group__xsecure__rsa__server__apis.html#ga7fe869dab6a634c2866f9ec26ee8cec0">XSecure_RsaOaepDecrypt()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
